package com.consumerzk.consumerzk.config;

import com.consumerzk.consumerzk.discovery.DiscoveryService;
import com.consumerzk.consumerzk.discovery.DiscoveryServiceImpl;
import com.consumerzk.consumerzk.rpc.RpcConsumerZk;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RPCzkconfig {

    @Bean
    public RpcConsumerZk rpcConsumerZk(){

        RpcConsumerZk rpcConsumer = new RpcConsumerZk();
        DiscoveryService discoveryService =new DiscoveryServiceImpl();
        discoveryService.discover("userService",rpcConsumer);
        return rpcConsumer;
    }
}
